Release 10.1A: OpenEdge Development:
Progress 4GL Reference
OVERLAY statement
Overlays a character expression in a field or variable starting at a given position, and optionally for a given length.
Syntax
targetThe name of the character field or variable that you want to overlay an
expression.positionAn integer expression that indicates the first character position in
targetwhere you want to storeexpression. The value ofpositionmust be positive. Ifpositionis longer thantarget, Progress padstargetwith blanks to matchposition.lengthAn integer expression that indicates the number of positions you want to allocate for the storage of
expression. Theexpressionis truncated or padded with blanks to matchlength. If you do not use thelengthargument or specify -1 as the length, OVERLAY uses the entireexpression.typeA character expression that directs Progress to interpret the specified
positionandlengthvalues as character units, bytes, or columns. A double-byte character registers as one character unit. By default, Progress interprets the specifiedpositionandlengthvalues as character units.There are three valid types: "CHARACTER," "RAW," and "COLUMN." The expression "CHARACTER" specifies character units. The expression "RAW" specifies bytes. The expression "COLUMN" specifies display or print character-columns. If you specify the type as a constant expression, Progress validates the type specification at compile time. If you specify the type as a non-constant expression, Progress validates the type specification at run time.
expressionAn expression that results in an integer value, constant, field name, variable name, or expression that results in a character string that you want to overlay on
Exampletarget. If you specifylength, theexpressionis truncated or padded with blanks to matchlength.The
r-replc1.pprocedure lets you search for, and replace text strings in a paragraph in a window. When you run the procedure, you see the paragraph, which is an array with an extent of five. You also see a prompt. Enter the text string you want the system to search for, and the new text you want in its place. The procedure searches the paragraph, one line at a time, for the text you entered. The procedure uses the OVERLAY statement to replace the string of old text with the string of new text. The procedure also determines the length of the old text and the new text.
Notes
- The OVERLAY statement is not equivalent to the SUBSTRING statement. When you use the OVERLAY statement, a specified number of byte or character units within the target string are overlaid with the same number of units from an expression. Therefore, the length of the target string does not change. The SUBSTRING statement replaces a specified number of units within the target string with the entire value of an expression. This may change the length of the target string.
- Do not split double-byte characters. This statement allows you to overlay either the lead or trail-byte of the target string when you specify "RAW" as the
typeparameter.See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |